def fun(n):
    s=0
    for i in range(1,n):
        if n % i == 0:
            s = s + i
        return 1 if s == n else 0
n= int(input("请输入一个整数: "))
print('YES') if fun(n) == 1 else print("NO")